#include <exception>
#include <filesystem>
#include <iostream>

#include "Args.h"
#include "MyInitial.h"
#include "MyRunTest.h"
#include "MyTestTypes.h"
#include "TestDoseStat.h"
#include "TestDoseStatCuda.h"

namespace fs = std::filesystem;

static int RunTest()
{
    mytesttypes::DoseStatIn ds{
        fs::path(MY_TESTIO_CASE1).generic_string(),
        "volumes",
        "doses",
    };
    MYINFO("Run test: dose statistics; file path {}, volumes array -> {}, doses array ->: {}\n", ds.filePath, ds.volumeName, ds.doseName);

    ///xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx test func: dose statistics
    /// dose statistics cpu
    (runTest(testdosestat::tt, ds));
    (runTest(testdosestat::tt_profile, ds));

    /// dose statistics gpu
    (runTest(testdosestatcuda::tt, ds));
    (runTest(testdosestatcuda::tt_profile, ds));

    return 0;
}

int main(int argc, char** argv)
{
    ///===================================================== 初始化日志系统
    Logger::init();
    ///===================================================== Args单例, 解析命令行参数
    args()->Parse(argc, argv);

    std::ignore = RunTest();

    return 0;
}